import java.io.IOException;


public class NoNamed {
	
	Runtime exec = Runtime.getRuntime();
	
	public void shutdownNow() throws IOException{
		
		exec.exec("sudo shutdown -now");
	}
	
	public void rebootNow() throws IOException{
		
		exec.exec("sudo reboot");
		
	}
	
	public void shutdownWhen(String time) throws IOException{
		
		String comm = "sudo shutdown -h ";
		System.out.println(comm.concat(time));
		exec.exec(comm.concat(time));
	}
	
	public void rebootWhen(String time) throws IOException{
		
		String comm = "sudo shutdown -r ";
		exec.exec(comm.concat(time));
	}
	
	public void shutdownCancel() throws IOException{
		
		exec.exec("sudo shutdown -c");
	}

}
